// ==UserScript==
// @name           Unpaginate OkCupid journal (microformat producer)
// @namespace      http://code.google.com/p/ecmanaut/
// @url            http://userscripts.org/scripts/source/23177.user.js
// @description    Marks up OkCupid journals with the pagination microformat.
// @require        http://ecmanaut.googlecode.com/svn/trunk/lib/gm/$x$X.js
// @require        http://ecmanaut.googlecode.com/svn/trunk/lib/addmetainfo.js
// @include        http://www.okcupid.com/journal*
// ==/UserScript==

// console.info("producing %x", location.href);

var nav = 'id("journal_nav")'; // this is where all the pagination controls live
addMeta("pagination-container", nav);

addMeta("items-xpath", 'id("posts")/div[@class="journalEntry"]'); // post cutter

var next = nav + '/text()[contains(.,"-")]/following-sibling::a'; // next page
addMeta("next-xpath", next);

var a = $X(next);
if (a)
  addLink("next", a.href);
